/**
 * Created with IntelliJ IDEA.
 * Description:
 * https://gitee.com/li--jiaqiang/java-test.git
 * git pull
 * git pull origin master
 * git pull origin master --allow-unrelated-histories
 * User: 86187
 * Date: 2022-05-03
 * Time: 10:33
 */

//Scanner scan = new Scanner(System.in);

import java.util.Scanner;

public class TestDemo4 {

    /**
     * 按顺序打印一个数字的每一位(例如 1234 打印出 1 2 3 4) （递归）
     * @param n
     */
    public static void printNum(int n) {
        if(n / 10 == 0) {
            System.out.print(n%10+" ");
            return;
        }
        printNum(n / 10);
        System.out.print(n%10+" ");
    }

    public static void main(String[] args) {

        printNum(12345);
    }
}
